package cn.yunhe.biz;

import java.util.List;

import cn.yunhe.dao.IUserDao;
import cn.yunhe.dao.UserDaoImpl;
import cn.yunhe.entity.User;

public class UserBizImpl implements IUserBiz {

	IUserDao userdao = new UserDaoImpl();
	public boolean addUser(String username, String password, String email, String phone, String provience, int academic) {
		int flag = userdao.addUser(username, password, email, phone, provience, academic);
		if(flag>0){
			return true;
		}else{
			return false;
		}
		
	}
	@Override
	public User searchUser(String username) {
		return userdao.searchUser(username);
	}
	@Override
	public boolean updateUser(String sql,Object[] pramas) {
		int flag = userdao.updateUser(sql,pramas);
		if(flag>0){
			return true;
		}else{
			return false;
		}
	}
	
	@Override
	public List<User> getAll() {
		// TODO Auto-generated method stub
		return userdao.getAll();
	}
	@Override
	public boolean delUser(int userid) {
		// TODO Auto-generated method stub
		int r = userdao.delUser(userid);
		return r>0?true:false;
	}

}
